/* Includes ------------------------------------------------------------------*/
#include "USB.h"

void USB_GPIO_Cfg(void)
{
		GPIO_InitTypeDef GPIO_InitStructure;	
//		NVIC_InitTypeDef NVIC_InitStructure;	
//		EXTI_InitTypeDef EXTI_InitStructure;
	/* GPIOD Periph clock enable */
  	RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOD, ENABLE);

  /* Configure PD8 as input floating (EXTI Line8) */
		GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
		GPIO_InitStructure.GPIO_Pin = GPIO_Pin_8;
		GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP;
		GPIO_Init(USB_PORT, &GPIO_InitStructure);
	
//	  /* Configure one bit for preemption priority */
//		NVIC_PriorityGroupConfig(NVIC_PriorityGroup_4);
//		/* Enable the EXTI15_10 Interrupt */
//		NVIC_InitStructure.NVIC_IRQChannel = EXTI9_5_IRQn;;
//		NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = 0;
//		NVIC_InitStructure.NVIC_IRQChannelSubPriority = 0;
//		NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE;
//		NVIC_Init(&NVIC_InitStructure);
//	
//	  /* Connect EXTI Line8 to PD.8 */
//		GPIO_EXTILineConfig(GPIO_PortSourceGPIOD, GPIO_PinSource8);

//		/* Configure EXTI Line8 to generate an interrupt on falling edge */  
//		EXTI_InitStructure.EXTI_Line = EXTI_Line8;
//		EXTI_InitStructure.EXTI_Mode = EXTI_Mode_Interrupt;
//		EXTI_InitStructure.EXTI_Trigger = EXTI_Trigger_Rising;
//		EXTI_InitStructure.EXTI_LineCmd = ENABLE;
//		EXTI_Init(&EXTI_InitStructure);
}
void USB_MODE(void)
{
		GPIO_InitTypeDef GPIO_InitStructure;	 
	/* GPIOD Periph clock enable */
  	RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOB, ENABLE);

 	 /* Configure PB12 13 14 15 in GPIO_Mode_IN_FLOATING mode */
  	GPIO_InitStructure.GPIO_Pin = USB_SD_MOSI|USB_SD_MISO|USB_SD_SCK|USB_SD_CS;
  	GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
  	GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN_FLOATING;
  	GPIO_Init(USB_SD_PORT, &GPIO_InitStructure);
}


